/**
 * 
 */
package org.cuatrovientos.rollthedice;

import java.util.Random;

/**
 * Represents a dice
 * @author daniel_ancin
 *
 */
public class Dice {

	// attributes
	
	private int sides;
	
	/**
	 * Constructor with sides
	 * @param sides
	 * 
	 */
	
	//constructor
	public Dice (){ //constructor no tiene retornos
			sides = 6;
		
	}
	public Dice (int sides){ 
		this.sides = sides;
	}
	
	/**
	 * rolls the dice
	 * @return value
	 */

	public int roll (){
		Random random = new Random();
		return random.nextInt(sides) + 1;
	}
	
	/**
	 * getter method for side
	 * @return sides
	 */

	public int getSides (){
		return sides;
	}
	
	/**
	 * setter method for sides
	 * @param sides sides
	 */
		
		public void setSides (int sides){
			this.sides = sides;
		}
		
	}

